package com.tjdr.his.domain.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tjdr.his.domain.entity.StorageInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface IStorageInfoMapper extends BaseMapper<StorageInfo> {
    @Select("select * from storage_info where  drug_type = #{drugType}" +
            " and (drug_name like '%${value}%' or drug_code like '%${value}%') limit ${start},${size}")
    public List<StorageInfo> selectStorageByTypeAndCodeOrName(String drugType, String value,int start,int size);

    @Select("select count(*) from storage_info where  drug_type = #{drugType}" +
            " and (drug_name like '%${value}%' or drug_code like '%${value}%')")
    public int selectStorageCountByTypeAndCodeOrName(String drugType, String value);

}
